package com.algo.service.impl;

import com.algo.config.db.Master;
import com.algo.config.db.Slave1;
import com.algo.mapper.UserMapper;
import com.algo.model.po.UserPO;
import com.algo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    @Slave1
    public List<UserPO> listUserFromSlave() {
        return userMapper.listUser();
    }

    @Override
    @Master
    public List<UserPO> listUserFromMaster() {
        return userMapper.listUser();
    }
}
